from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score

def ret_calculate(target, prediction):

    # acc分数
    accuracy = accuracy_score(target, prediction)

    # 预测精度
    precision = precision_score(target, prediction)

    # 回归分数
    recall = recall_score(target, prediction)

    # f1分数
    f1 = f1_score(target, prediction)

    return accuracy, precision, recall, f1
